<?php
namespace app\task\models;

use app\task\lib\ArDBLib;

class TaskModel extends ArDBLib{

    public static function tableName(){
        return '@task';
    }

    public function setTaskLog($data=[]){
        if (!empty($data['task_md5'])){
            $thisData = self::find()->where([
                ['=','task_md5',$data['task_md5']],['!=','task_frequency',0]
                ],'and')->one();
            if (!empty($thisData[0])){
                return $thisData[0];
            }
        }
        self::find()->insert($data);
        return $data;
    }

}